<?php
namespace App\Http\ViewComposers;


use App\Services\Cookie\Carts;
use Illuminate\Http\Request;
use Illuminate\View\View;

class ProductHeaderComposer
{
    protected $request;

    public function __construct(Request $request)
    {
        $this->request = $request;
    }

    /**
     * Bind data to the view.
     *
     * @param  View  $view
     * @return void
     */
    public function compose(View $view)
    {
        $carts_service = new Carts($this->request);
        $carts_data_arr = $carts_service->getGlobalData();

        view()->share('carts_data_arr', $carts_data_arr);
    }

}